/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities_wegan;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author wegan
 */
@Entity
@Table(name = "ACTIVITY", catalog = "", schema = "APP")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Activity.findAll", query = "SELECT a FROM Activity a"),
    @NamedQuery(name = "Activity.findByActivityname", query = "SELECT a FROM Activity a WHERE a.activityname = :activityname"),
    @NamedQuery(name = "Activity.findByStartdatetime", query = "SELECT a FROM Activity a WHERE a.startdatetime = :startdatetime"),
    @NamedQuery(name = "Activity.findByActivitytype", query = "SELECT a FROM Activity a WHERE a.activitytype = :activitytype"),
    @NamedQuery(name = "Activity.findByTime", query = "SELECT a FROM Activity a WHERE a.time = :time"),
    @NamedQuery(name = "Activity.findByDistance", query = "SELECT a FROM Activity a WHERE a.distance = :distance"),
    @NamedQuery(name = "Activity.findByDescription", query = "SELECT a FROM Activity a WHERE a.description = :description"),
    @NamedQuery(name = "Activity.findByActivityid", query = "SELECT a FROM Activity a WHERE a.activityid = :activityid")})
public class Activity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Size(max = 20)
    @Column(name = "ACTIVITYNAME", length = 20)
    private String activityname;
    @Column(name = "STARTDATETIME")
    @Temporal(TemporalType.DATE)
    private Date startdatetime;
    @Size(max = 20)
    @Column(name = "ACTIVITYTYPE", length = 20)
    private String activitytype;
    @Column(name = "TIME")
    private Integer time;
    @Column(name = "DISTANCE")
    private Integer distance;
    @Size(max = 60)
    @Column(name = "DESCRIPTION", length = 60)
    private String description;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ACTIVITYID", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date activityid;

    public Activity() {
    }

    public Activity(Date activityid) {
        this.activityid = activityid;
    }

    public String getActivityname() {
        return activityname;
    }

    public void setActivityname(String activityname) {
        this.activityname = activityname;
    }

    public Date getStartdatetime() {
        return startdatetime;
    }

    public void setStartdatetime(Date startdatetime) {
        this.startdatetime = startdatetime;
    }

    public String getActivitytype() {
        return activitytype;
    }

    public void setActivitytype(String activitytype) {
        this.activitytype = activitytype;
    }

    public Integer getTime() {
        return time;
    }

    public void setTime(Integer time) {
        this.time = time;
    }

    public Integer getDistance() {
        return distance;
    }

    public void setDistance(Integer distance) {
        this.distance = distance;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getActivityid() {
        return activityid;
    }

    public void setActivityid(Date activityid) {
        this.activityid = activityid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (activityid != null ? activityid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Activity)) {
            return false;
        }
        Activity other = (Activity) object;
        if ((this.activityid == null && other.activityid != null) || (this.activityid != null && !this.activityid.equals(other.activityid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities_wegan.Activity[ activityid=" + activityid + " ]";
    }
    
}
